{% extends "package/view_edit_base.html" %}

{% block subtitle %}{{ _('Add view') }} {{ g.template_title_delimiter }} {{ h.resource_display_name(resource) }}{% endblock %}
{% block form_title %}{{ _('Add view') }}{% endblock %}

{% block breadcrumb_content %}
  {{ super() }}
  <li class="active"><a href="#">{{ _('Add view') }}</a></li>
{% endblock %}

{% block content_primary_nav %}
  <li class="active"><a href="#"><i class="fa fa-pencil-square-o"></i> {{ _('Add view') }}</a></li>
{% endblock %}

{% block form %}
  {% if resource_view.view_type == 'recline_view' and not datastore_available %}
    <p class="text-info">
      <i class="fa fa-info-circle"></i>
      {% trans %}
      Data Explorer views may be slow and unreliable unless the DataStore extension is enabled. For more information, please see the <a href='http://docs.ckan.org/en/latest/maintaining/data-viewer.html#viewing-structured-data-the-data-explorer' target='_blank'>Data Explorer documentation</a>.
      {% endtrans %}
    </p>
  {% endif %}

  <form class="dataset-form dataset-resource-form" method="post" data-module="basic-form resource-form">
    {% include 'package/snippets/view_form.html' %}
    <div class="form-actions">
        <button class="btn btn-default {% if not h.resource_view_display_preview(data) %}hide{%endif%}" name="preview" value="True" type="submit">{{ _('Preview') }}</button>
        <button class="btn btn-primary" name="save" value="Save" type="submit">{% block save_button_text %}{{ _('Add') }}{% endblock %}</button>
    </div>
  </form>
{% endblock %}
